﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Master/HomeSubMaster.Master" AutoEventWireup="true"
    ValidateRequest="false" CodeBehind="ServiceType.aspx.cs" Inherits="CSP.Web.MyHome.ServiceInfo.ServiceType" %>

<asp:Content ID="CSPHead" ContentPlaceHolderID="CSPHead" runat="server">
    <meta charset="utf-8">
    <title>服务发布-服务类型</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="">
</asp:Content>
<asp:Content ID="CSPStyleAndScript" ContentPlaceHolderID="CSPStyleAndScript" runat="server">
    <link href="/Styles/theme/base/home/public-type.css" rel="stylesheet">
    <link href="/Styles/lib/jquery-ui/jquery-ui-1.8.22.custom.css" rel="stylesheet" type="text/css" />
    <link href="/Styles/lib/jquery-ui/jquery.ui.button.css" rel="stylesheet" type="text/css" />
    <script src="/Scripts/UI/Jquery/jquery.ui.core.js" type="text/javascript"></script>
    <script src="/Scripts/UI/Jquery/jquery.ui.widget.min.js" type="text/javascript"></script>
    <script src="/Scripts/UI/Jquery/jquery.ui.position.min.js" type="text/javascript"></script>
    <script src="/Scripts/UI/Jquery/jquery.ui.dialog.js" type="text/javascript"></script>
    <script src="/Scripts/UI/Expand/dialog.js" type="text/javascript"></script>
    <script language="javascript">

        $().ready(function () {
            CheckContactCount();
            Load_DomainType();
        });
        //验证联系方式是否填写
        function CheckContactCount() {
            $.ajax({
                type: "get",
                dataType: "json",
                //data: { OrderNumber: ordernumber, ShipmentID:shipmentID, Notes: notes, Action: "CancelShipmentByID" },
                url: "ServiceType.aspx?CheckContactCount=1",
                async: false,
                cache: false,
                error: function (result) {
                    result;
                },
                success: function (data, textStatus) {
                    if (data.status == 0) {
                        DialogMessage.Show(2, "亲,您还没有添加[<span style='color:red'>用于及时沟通</span>]的QQ或淘宝旺旺联系方式哦,请您先添加及时沟通的联系方式[<span style='color:red'>QQ</span>]或者[<span style='color:red'>淘宝旺旺</span>],这样用户才能及时的与您沟通保证第一时间拿下订单哦~", function () {
                            window.location.href = "/MyHome/ContactWay/Info.aspx?urlback=" + encodeURI("/MyHome/ServiceInfo/ServiceType.aspx");
                        });  //请选择服务类型

                    }
                }
            });
        }
        function Load_DomainType() {
            $.ajax({
                type: "get",
                dataType: "json",
                //data: { OrderNumber: ordernumber, ShipmentID:shipmentID, Notes: notes, Action: "CancelShipmentByID" },
                url: "ServiceType.aspx?domainType=1",
                async: false,
                error: function (result) {
                    result;
                },
                success: function (data, textStatus) {
                    var selectDomainType = $("#S_DomainType");
                    selectDomainType.find("li").remove();
                    $.each(data, function (index, item) {
                        var option = "<li class=\"cc-tree-item cc-hasChild-item \" onclick=\"S_DomainType_OnChange(this)\" style=\"\" value=\"" + item.Id + "\">" + item.Name + "</li>";
                        selectDomainType.append(option);

                    });
                    selectDomainType.find("li").eq(0).addClass("cc-selected");
                    S_DomainType_OnChange(selectDomainType.find("li").eq(0));
                }
            });
        }

        function S_DomainType_OnChange(obj) {
            SelectedOption(obj);
            if ($("#S_DomainType").find(".cc-selected").length == 0) {
                return false;
            }
            $.ajax({
                type: "get",
                dataType: "json",
                //data: { OrderNumber: ordernumber, ShipmentID:shipmentID, Notes: notes, Action: "CancelShipmentByID" },
                url: "ServiceType.aspx?parentid=" + $("#S_DomainType").find(".cc-selected").attr("value"),
                async: false,
                error: function (result) {
                    result;
                },
                success: function (data, textStatus) {
                    var selectServiceType = $("#S_ServiceType");
                    selectServiceType.find("li").remove();
                    $.each(data, function (index, item) {
                        var option = "<li class=\"cc-cbox-item cc-hasChild-item \" onclick=\"S_ServiceType_OnChange(this)\" style=\"\" value=\"" + item.Id + "\">" + item.Name + "</li>";
                        selectServiceType.append(option);

                    });
                    selectServiceType.find("li").eq(0).addClass("cc-selected");
                    S_ServiceType_OnChange(selectServiceType.find("li").eq(0));
                }
            });
        }

        function S_ServiceType_OnChange(obj) {
            SelectedOption(obj);
            if ($("#S_ServiceType").find(".cc-selected").length == 0) {
                return false;
            }
            $.ajax({
                type: "get",
                dataType: "json",
                //data: { OrderNumber: ordernumber, ShipmentID:shipmentID, Notes: notes, Action: "CancelShipmentByID" },
                url: "ServiceType.aspx?parentsubid=" + $("#S_ServiceType").find(".cc-selected").attr("value"),
                async: false,
                error: function (result) {
                    result;
                },
                success: function (data, textStatus) {
                    var selectServiceSubType = $("#S_ServiceTypeSub");
                    selectServiceSubType.find("li").remove();
                    //selectServiceSubType.append("<option value=''>请选择服务子类型</option>");
                    $.each(data, function (index, item) {
                        var option = "<li class=\"cc-cbox-item cc-hasChild-item \" style=\"\" onclick=\"SelectedOption(this)\" value=\"" + item.Id + "\">" + item.Name + "</li>";
                        selectServiceSubType.append(option);


                    });
                    selectServiceSubType.find("li").eq(0).addClass("cc-selected");
                }
            });
        }

        function SelectedOption(obj) {
            var lis = $(obj).parent().find("li");
            lis.removeClass("cc-selected");
            $(obj).addClass("cc-selected");
        }

        function ServiceNext() {
            if ($("#S_DomainType").find(".cc-selected").length == 0) {
                DialogMessage.Show(2, "请选择领域类型"); //请选择领域类型
                return;
            }
            if ($("#S_ServiceType").find(".cc-selected").length == 0) {
                DialogMessage.Show(2, "请选择服务类型"); //请选择服务类型
                return;
            }
            if ($("#S_ServiceTypeSub").find(".cc-selected").length == 0) {
                DialogMessage.Show(2, "请选择服务子类型");  //请选择服务类型
                return;
            }

            var domainType = $("#S_DomainType");
            var serviceType = $("#S_ServiceType");
            var serviceTypeSub = $("#S_ServiceTypeSub");
            var infoType = domainType.find(".cc-selected").html() + "|" + domainType.find(".cc-selected").attr("value") + "," + serviceType.find(".cc-selected").html() + "|" + serviceType.find(".cc-selected").attr("value") + "," + serviceTypeSub.find(".cc-selected").html() + "|" + serviceTypeSub.find(".cc-selected").attr("value");
            var form = $("<form type='post' name='F_TypeInfo' action='add.aspx'><input type='text' id='InfoType' name='InfoType' value='" + encodeURI(infoType) + "'/></form>");
            form.appendTo("body");
            form.submit();

            //window.location.href = "Add.aspx?InfoType=" + encodeURI(typeInfo);
        }

    </script>
</asp:Content>
<asp:Content ID="CSPCrumbs" ContentPlaceHolderID="CSPCrumbs" runat="server">
    <div class="crumbs">
        <span>您当前所在的位置：</span> <a href="/">首页</a> &gt; <a href="/MyHome/ServiceOrder/List.aspx">我是服务者</a> &gt; <span>发布类型</span>
    </div>
    <!--crumbs-->
</asp:Content>
<asp:Content ID="CSPMains" ContentPlaceHolderID="CSPMain" runat="server">
    <div class="box-bd grid-m0 post-message home">
        <!-- {{{ flowsteps -->
        <div class="flowsteps">
            <ol class="num3">
                <li class="current"><span class="first">1. 选择服务类型</span></li>
                <li class="next"><span>2. 填写服务信息</span></li>
                <li><span class="last">3. 发布成功</span></li>
            </ol>
        </div>
        <!-- flowsteps }}} -->
        <div class="post-cont mh500">
            <%--<table width="80%" border="0" cellspacing="0" cellpadding="0">
                <tr>
                    <td width="20%" height="100" align="right">
                        课程类型：
                    </td>
                    <td width="80%">
                        <select class="select-m" id="S_DomainType" runat="server" onchange="return S_DomainType_OnChange()">
                        </select>
                        <select class="select-m" id="S_ServiceType" onchange="return S_ServiceType_OnChange()"
                            runat="server">
                            <option value="">请选择服务类型</option>
                        </select>
                        <select class="select-m" id="S_ServiceTypeSub" runat="server">
                            <option value="">请选择服务子类型</option>
                        </select>
                    </td>
                </tr>
                <tr>
                    <td height="100" align="center" colspan="2">
                        <a href="javascript:ServiceNext();" class="ui-btn-confirm">下一步</a>&nbsp;
                    </td>
                </tr>
            </table>--%>

             <!-- 选择分类开始 -->
            <div data-spm="1000796" class="cate-container">
              <div id="cate-cascading"> <a id="J_LinkPrev" title="上一级" class="cc-prev cc-nav" href="#" style="visibility: hidden;"><span>上一级</span></a>
                <div class="cc-listwrap">
                  <ol class="cc-list" id="J_OlCascadingList">
                    <li class="cc-list-item" tabindex="-1">
                      <ul role="tree" tabindex="0" hidefocus="-1" unselectable="on" class="cc-tree" aria-activedescendant="cc-tree-item4">
                        <li role="treeitem" class="cc-tree-group  cc-tree-expanded" aria-expanded="true">
                          <div id="cc-tree-gname1" class="cc-tree-gname">选择领域类型</div>
                          <ul role="group" class="cc-tree-gcont" id="S_DomainType">
                            <!--<li role="treeitem" id="cc-tree-item2" class="cc-tree-item cc-hasChild-item cc-selected">培训专区 </li>
                            <li role="treeitem" id="cc-tree-item3" class="cc-tree-item cc-hasChild-item">亲子生活</li>
                            <li role="treeitem" id="cc-tree-item4" class="cc-tree-item cc-hasChild-item" aria-selected="true">课外拓展</li>
                            <li role="treeitem" id="cc-tree-item5" class="cc-tree-item cc-hasChild-item">家教</li>-->
                          </ul>
                        </li>
                      </ul>
                    </li>
                    <li class="cc-list-item" tabindex="-1">
                      <div role="combobox" class="cc-cbox" aria-activedescendant="cc-cbox-item3">
                        <div class="cc-cbox-filter">
                          <label for="cc-cbox-filter257" style="">输入名称/拼音首字母</label>
                          <input role="textbox" autocomplete="off" id="cc-cbox-filter257" style="width: 192px;">
                        </div>
                        <ul role="listbox" class="cc-cbox-cont" id="S_ServiceType">
                          <!--<li role="option" id="cc-cbox-item1" class="cc-cbox-item cc-hasChild-item cc-selected" style="">少儿英语</li>
                          <li role="option" id="cc-cbox-item2" class="cc-cbox-item cc-hasChild-item" style="">早教学前</li>-->
                          
                        </ul>
                      </div>
                    </li>
                    <li class="cc-list-item" tabindex="-1">
                      <div role="combobox" class="cc-cbox" aria-activedescendant="cc-cbox-item2">
                        <div class="cc-cbox-filter">
                          <label for="cc-cbox-filter270">输入名称/拼音首字母</label>
                          <input role="textbox" autocomplete="off" id="cc-cbox-filter270" style="width: 192px;">
                        </div>
                        <ul role="listbox" class="cc-cbox-cont" id="S_ServiceTypeSub">
                          <!--<li role="option" id="cc-cbox-item1" class="cc-cbox-item cc-hasChild-item"><i>q</i>启蒙英语</li>
                          <li role="option" id="cc-cbox-item2" class="cc-cbox-item cc-hasChild-item cc-selected" aria-selected="true">外交口语</li>
                          <li role="option" id="cc-cbox-item3" class="cc-cbox-item cc-hasChild-item">英语竞赛</li>
                          <li role="option" id="cc-cbox-item4" class="cc-cbox-item cc-hasChild-item">新概念</li>
                          <li role="option" id="cc-cbox-item5" class="cc-cbox-item cc-hasChild-item">英语综合</li>
                          <li role="option" id="cc-cbox-item6" class="cc-cbox-item cc-hasChild-item">法语</li>
                          <li role="option" id="cc-cbox-item7" class="cc-cbox-item cc-hasChild-item">德语</li>
                          <li role="option" id="cc-cbox-item8" class="cc-cbox-item cc-hasChild-item">韩语</li>
                          <li role="option" id="cc-cbox-item9" class="cc-cbox-item cc-hasChild-item">日语</li>
                          <li role="option" id="cc-cbox-item10" class="cc-cbox-item cc-hasChild-item">其它外语</li>-->
                        </ul>
                      </div>
                    </li>
                  </ol>
                </div>
                <a id="J_LinkNext" title="下一级" class="cc-next cc-nav" href="#" style="visibility: hidden;"><span>下一级</span></a> </div>
              <div style="display:none;" class="search-result" id="J_SearchResult">
                <div class="result-note"> <strong>匹配到<em class="J_RecordCount">0</em>个类目</strong><span class="note">(双击直接发布，括号中为该类目下相关宝贝的数量)</span> <a href="#exit" class="J_TriggerExit trigger-exit"><i></i>关闭，返回类目</a> </div>
                <div class="result-list">
                  <ol>
                  </ol>
                  <a href="#expand" class="J_FlexTrigger trigger-expand">展开更多<i></i></a> <a href="#close" class="J_FlexTrigger trigger-close">收起更多<i></i></a> </div>
              </div>
              <div class="cc-loading">
                <div class="cc-loading-content">
                  <div class="cc-loading-icon"><img src="http://img03.taobaocdn.com/tps/i3/T1jBamXj4fXXXXXXXX-16-16.gif"></div>
                  <span class="cc-loading-text">加载中，请稍候...</span> </div>
              </div>
            </div>
            <div class="cate-path">
              <dl>
                  <div class="clearfix">
                      <dt>您当前选择的是：</dt>
                      <dd>
                          <ol id="J_OlCatePath" class="category-path"><li>培训专区 </li><li>&nbsp;&gt;&nbsp;少儿英语</li><li>&nbsp;&gt;&nbsp;外交口语</li></ol>
                          <div class="cate-desc" id="J_EmCateDesc" style="display: none;" title="">实物，需要寄送手机</div>
                      </dd>
                  </div>
          
              </dl>
              <span class="arrow up" id="J_SpanPointer"></span>
          </div>
          <!-- 选择分类结束 -->
          	<p class="mb10" align="center"><a href="javascript:ServiceNext();" class="ui-btn-confirm">下一步</a></p>
        </div>
        <!--post-cont-->
    </div>
    <!--grid-m0-->
</asp:Content>
